package com.nf.action;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;


public class Test {
    public static void main(String[] args) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        Student student = (Student) ac.getBean("s2");

//        Properties properties = student.getProperties();
//        System.out.println(properties);
//        System.out.println(properties.getProperty("dataName")+properties.getProperty("user")+properties.getProperty("password"));
//        Map<String,Car> map = student.getCarMap();
//        Car car = map.get("湘A66666");
//        System.out.println(car.getName());
//        List<Car> car = student.getCars();
//        for (Car car1 : car) {
//            System.out.println(car1.getName()+"二手的，价格在"+car1.getPrice());
//        }
//        Car car = (Car) ac.getBean("c1");
//        student.setCar(car);
//        System.out.println(student.getName()+"的车名字叫做"+car.getName());

    }
}
